﻿using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Media;
using LiveCharts.Definitions.Points;
using LiveCharts.Definitions.Series;
using LiveCharts.Dtos;
using LiveCharts.SeriesAlgorithms;
using LiveCharts.Wpf;

namespace LiveCharts.Wpf
{
	public class GStackedRowSeries : Series, ISeriesView, IStackModelableSeriesView, IGroupedStackedSeriesView, IStackedRowSeriesView
	{
		public GStackedRowSeries()
		{
			base.Model = new StackedRowAlgorithm(this);
			this.method_0();
		}

		public GStackedRowSeries(object configuration)
		{
			base.Model = new StackedRowAlgorithm(this);
			base.Configuration = configuration;
			this.method_0();
		}

 
		public double MaxRowHeight
		{
			get
			{
				return (double)base.GetValue(GStackedRowSeries.MaxRowHeightProperty);
			}
			set
			{
				base.SetValue(GStackedRowSeries.MaxRowHeightProperty, value);
			}
		}

	 
		public double RowPadding
		{
			get
			{
				return (double)base.GetValue(GStackedRowSeries.RowPaddingProperty);
			}
			set
			{
				base.SetValue(GStackedRowSeries.RowPaddingProperty, value);
			}
		}
 
		public StackMode StackMode
		{
			get
			{
				return (StackMode)base.GetValue(GStackedRowSeries.StackModeProperty);
			}
			set
			{
				base.SetValue(GStackedRowSeries.StackModeProperty, value);
			}
		}

		public override IChartPointView GetPointView(ChartPoint point, string label)
		{
			Class9 @class = (Class9)point.View;
			if (@class == null)
			{
				Class9 class2 = new Class9();
				class2.IsNew = true;
				class2.method_1(new Class3());
				class2.Data = new CoreRectangle();
				class2.method_3(BarLabelPosition.Merged);
				@class = class2;
			}
			else
			{
				@class.IsNew = false;
				point.SeriesView.Model.Chart.View.EnsureElementBelongsToCurrentDrawMargin(@class.DataLabel);
			}
			if (@class.HoverShape != null)
			{
				@class.HoverShape.Visibility = base.Visibility;
			}
			if (base.DataLabels && @class.DataLabel == null)
			{
				@class.DataLabel = (@class.DataLabel = base.UpdateLabelContent(new DataLabelViewModel
				{
					FormattedText = label,
					Point = point
				}, @class.DataLabel));
			}
			if (!base.DataLabels && @class.DataLabel != null)
			{
				base.Model.Chart.View.RemoveFromDrawMargin(@class.DataLabel);
				@class.DataLabel = null;
			}
			return @class;
		}

	 
		private void method_0()
		{
			base.SetCurrentValue(Series.StrokeThicknessProperty, 0.0);
			base.SetCurrentValue(GStackedRowSeries.MaxRowHeightProperty, 35.0);
			base.SetCurrentValue(GStackedRowSeries.RowPaddingProperty, 2.0);
			base.SetCurrentValue(Series.ForegroundProperty, Brushes.White);
			Func<ChartPoint, string> value = new Func<ChartPoint, string>(this.method_1);
			base.SetCurrentValue(Series.LabelPointProperty, value);
			base.DefaultFillOpacity = 1.0;
			 
		}

	 
		public object Grouping { get; set; }

	 
		[CompilerGenerated]
		private string method_1(ChartPoint chartPoint_0)
		{
			return base.Model.CurrentXAxis.GetFormatter()(chartPoint_0.X);
		}

		public static readonly DependencyProperty MaxRowHeightProperty = DependencyProperty.Register("MaxRowHeight", typeof(double), typeof(GStackedRowSeries), new PropertyMetadata(0.0));

		public static readonly DependencyProperty RowPaddingProperty = DependencyProperty.Register("RowPadding", typeof(double), typeof(GStackedRowSeries), new PropertyMetadata(0.0));

		public static readonly DependencyProperty StackModeProperty = DependencyProperty.Register("StackMode", typeof(StackMode), typeof(GStackedRowSeries), new PropertyMetadata(StackMode.Values));

		[CompilerGenerated]
		private object object_0;
	}
}
